/*
	GadgetDrive.h
	(c)1999 PaleStar Development, Richard Lyle
*/

#ifndef GADGET_DRIVE_H
#define GADGET_DRIVE_H

#include "NounGadget.h"
#include "Constants.h"
#include "GameDll.h"

//----------------------------------------------------------------------------

class DLL GadgetDrive : public NounGadget
{
public:
	DECLARE_WIDGET_CLASS();
	DECLARE_PROPERTY_LIST();

	// Construction
	GadgetDrive();

	// Noun interface
	void					setup();
	void					initialize();
	void					inflictDamage( dword nWhen, Noun * pFrom, int damage, 
								dword type, const Vector3 & direction );	

	// NounGadget interface
	Type					type() const;					// get gadget type
	EnergyClass				energyClass() const;

	float					addThrust() const;
	int						addMaxEnergy() const;
	float					addSignature() const;	

	bool					usable( Noun * pTarget, 
								bool shift ) const;			// can gadget be used on target
	bool					useActive() const;				// is the gadget current on or off
	void					use( dword when, Noun * pTarget,
								bool shift);				// use gadget
	int						useEnergy( dword nTick, 
								int energy );

	// Accessors
	virtual float			thrust() const = 0;				// thrust produced by this drive
	virtual int				maxEnergy() const = 0;			// max energy added by this drive
	virtual int				energy() const = 0;				// energy generated by this drive
	virtual int				energyFalloff() const = 0;		// amount of energy lost when drive at full velocity

	bool					active() const;

private:
};

//----------------------------------------------------------------------------

inline bool GadgetDrive::active() const
{
	return (flags() & FLAG_ACTIVE) != 0;
}

//----------------------------------------------------------------------------

#endif

//----------------------------------------------------------------------------
// EOF
